<template>
  <view class="main-box">
    <view class="content-body">
      <view class="banner box-shadow">
        <u-image width="100%" height="100%" :src="src" />
      </view>
      <u-card :border-radius="10" box-shadow="2px 2px 6px rgba(0, 0, 0, .3)" class="form-box">
        <template #body>
          <view class="">
            <view class="title">
              <view class="icon-box u-type-success">
                <u-icon name="chenggong" custom-prefix="custom-icon" size="100" />
              </view>
              资料提交成功
            </view>
            <view class="sub-title">
              <view class="">
                资料提交成功，请耐心等待审核！
              </view>
              <view class="">
                页面将在<text class="u-type-primary">{{ secondsCount }}</text>秒后跳转
              </view>
            </view>
          </view>
        </template>
      </u-card>
    </view>
	
    <view class="foot">
      <foot-box />
    </view>
  </view>
</template>
<script setup name='submitRes'>
import { reactive, toRefs, ref, getCurrentInstance, watch } from 'vue'
import { onLoad, onReady } from '@dcloudio/uni-app'
import footBox from '@/components/foot-box/index.vue'

const src = ref('/static/images/cs.png')
const { proxy } = getCurrentInstance()

const secondsCount = ref(10)
const timer = ref()
function startCountdown() {
    timer.value = setInterval(() => {
        if (secondsCount.value > 0) {
	  secondsCount.value--
        } else {
	  clearInterval(timer.value)
        }
    }, 1000)
}
watch(() => secondsCount.value, () => {
    if (secondsCount.value === 0) {
        console.log('倒计时完成！') 
    }
})

onLoad((options) => {
    console.log('页面加载时的参数：', options)
})
onReady(() => {
    startCountdown()
})

</script>
<style lang='scss' scoped>
	@import "../../common/index.css";
	.title,.sub-title{
		text-align: center;
	}
	.title{
		font-size: 42rpx;
		font-weight:700;
		color: rgb(140,140,140);
		padding-bottom: 20rpx;
	}
	.sub-title{
		padding-bottom: 20rpx;
	}
	.icon-box{
		
	}
</style>
